<template>
	<div id="sure_order">
		<ul class="consignee">
			<div id="app">
				<a @click="itemClicked(active1)">
					<li class="consignee_name">
						<p>联系人：{{active1.urname}}</p>
						<span>{{active1.urphone}}</span>
						<div class="clear"></div>
					</li>
				</a>
			</div>
		</ul>

		<div id="app1">
			<div class="my_goods_list">
				<div class="commodity_list">旅游订单</div>
				<ul>
					<li class="commodity_list_nav">
						<!-- <img src="https://yo.docshare.org.cn..//static/images/my_order01.jpg"/> -->
						<img :src="'https://yo.docshare.org.cn'+active.contentphoto">
						<div class="project_cont">
							<p>{{active.name}}三日游...</p>
						</div>
						<div class="money">
							<label class="VIP-price">￥{{active.cost}}</label><span>x1</span>
						</div>
						</a>
					</li>
				</ul>
			</div>
			<div id="total_money">
				<div class="choose_all">
					<ul>
						<li class="total">合计：<span>￥{{active.cost}}</span></li>
						<li class="no_freight">可获得500积分</li>
					</ul>
				</div>
				<div id='app1'>
					<input class="settlement" type="button" @click="submit1()" value="确认订单"></input>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	import config from '@/config'
	export default {
		data() {
			return {
				usr: '',
				active1: {},
				active:{},
				vid: '',
				vvid:'',
			}
		},
		onLoad(option) {
			if (option.id) {
				this.vid = option.id;
			}
			if(option.id2){
				this.vvid = option.id2;
			}
			var that = this;
			uni.request({
				url: `${config.baseUrl}/active/one?token=` + uni.getStorageSync('token') + '&id=' + that.vid,
				method: 'GET',
				success(r) {
					if (r.data.succ) {
							that.active = r.data.data;
					} else {
					
					}
				},
				complete(res){
					if(res.data && res.data.msg){
						uni.showToast({
							icon:'none',
							title:res.data.msg
						})
					}
				},
			});
			uni.request({
				url: `${config.baseUrl}/comment/one1?token=` + uni.getStorageSync('token') + '&id=' + that.vid,
				method: 'GET',
				success(r) {
					if (r.data.succ) {
							that.active1 = r.data.data;
					} else {
					
					}
				},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
			});
		},
		methods: {
			submit1:function(){
				console.log("进入App1");
				console.log("actid="+this.vid);
				console.log("addressid="+this.vvid);
				uni.request({
					url: `${config.baseUrl}/comment/ret?token=` + uni.getStorageSync('token'),
					method: 'POST',
					data: {'actid':this.vid,'addressid':this.vvid},
					success(r) {
						if (r.data.succ) {
							uni.navigateTo({
								url:'payment'
							})
						}
					},
					complete(res){
						if(res.data && res.data.msg){
							uni.showToast({
								icon:'none',
								title:res.data.msg
							})
						}
					},
				});	
			},
			itemClicked: function(item) {
				uni.navigateTo({
					url: 'offen_user?id=' + this.vid + '&id2=' + this.vvid
				})
			},
		}
	}
</script>

<style>
</style>
